PIM Sparse Mode

Published: 2022-01-03

  • The multicast receiver must use Source-Specific Multicast (IGMPv3), or
  • The multicast network must use a Rendezvous Point.

Initial Configuration and Topology

Interface fa0/0 on each router connects to its local PC. Here we have IGMPv3 enabled. Interface fa1/0 and fa2/0 connect to the other routers, creating a ring topology. We use OSPF to exchange unicast routes.

ip multicast-routing
!
interface FastEthernet0/0
 description LAN
 ip address 10.0.1.1/24
 ip igmp version 3
 ip ospf 1 area 0
!
interface FastEthernet1/0
 description R1-R2 link
 ip address 10.1.2.1/24
 ip ospf 1 area 0
!
interface FastEthernet2/0
 description R1-R3 link
 ip address 10.1.3.1/24
 ip ospf 1 area 0

ip multicast-routing
!
interface FastEthernet0/0
 description LAN
 ip address 10.0.2.1/24
 ip igmp version 3
 ip ospf 1 area 0
!
interface FastEthernet1/0
 description R1-R2 link
 ip address 10.1.2.2/24
 ip ospf 1 area 0
!
interface FastEthernet2/0
 description R2-R3 link
 ip address 10.2.3.2/24
 ip ospf 1 area 0

ip multicast-routing
!
interface FastEthernet0/0
 description LAN
 ip address 10.0.3.1/24
 ip igmp version 3
 ip ospf 1 area 0
!
interface FastEthernet1/0
 description R1-R3 link
 ip address 10.1.3.3/24
 ip ospf 1 area 0
!
interface FastEthernet2/0
 description R2-R3 link
 ip address 10.2.3.3/24
 ip ospf 1 area 0

interface FastEthernet0/0
 ip address 10.0.1.11 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.0.1.1

interface FastEthernet0/0
 ip address 10.0.2.22 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.0.2.1

interface FastEthernet0/0
 ip address 10.0.2.33 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.0.3.1


PIM-SM with Source-Specific Multicast

Because of how sparse-mode operates, a multicast flow is not forwarded unless the First-Hop Router closest to the source receives a downstream PIM Join message. By having the receiver specify the source IP address for the flow, the PIM-routers can quickly signal the multicast tree by comparing the source IP with the unicast routing table and sending a PIM Join message wherever the route is pointing.

To see PIM-SM SSM in action our routers need to activate SSM-mode with the ip pim ssm default command. The keyword default means that PIM SSM should only be activated for the default SSM range 232/8. Finally we tell PC22 to join the (10.0.1.11, 232.1.1.1) multicast group:

ip pim ssm default
!
interface range fa0/0,fa1/0,fa2/0
 ip pim sparse-mode

int fa0/0
 ip igmp version 3
 ip igmp join-group 232.1.1.1 source 10.0.1.11

IGMP & PIM Debug output

IGMP(0): Send v3 general Query on FastEthernet0/0
IGMP(0): Received v3 Report for 2 groups on FastEthernet0/0 from 10.0.2.22
IGMP(0): MRT Add/Update FastEthernet0/0 for (*,239.1.1.1) by 0
IGMP(0): MRT Add/Update FastEthernet0/0 for (10.0.1.11,232.1.1.1) by 0
PIM(0): Adding v2 (10.0.1.11/32, 232.1.1.1), S-bit Join
PIM(0): Send v2 join/prune to 10.1.2.1 (FastEthernet1/0)

PIM(0): Received v2 Join/Prune on FastEthernet1/0 from 10.1.2.2, to us
PIM(0): Join-list: (10.0.1.11/32, 232.1.1.1), S-bit set
PIM(0): Update FastEthernet1/0/10.1.2.2 to (10.0.1.11, 232.1.1.1), Forward state

As soon as R2 received the IGMPv3 membership report from PC22 for (10.0.1.11,232.1.1.1), R2 performed a routing routing lookup to find the shortest path to 10.0.1.11. The shortest path is to R1, so R2 generates a PIM Join message that it immediately sends to R1. If the R1-R2 link was down, R2 would send the PIM Join to R3 who would send its own PIM Join to R1, again completing the multicast tree.


PIM Sparse Mode with Rendezvous Point

What if you can't rely on the receivers to specify a multicast flow source? In this case you must setup a common meeting point in the network for the PIM Join messages. This is called a rendezvous point. By having all routers send their PIM Join messages to the RP it can coordinate and forward the PIM messages towards the source allowing multicast traffic to flow through the RP, building a so-called Root Path Tree, RPT.

However, to complete the PIM RP signaling we must introduce a new PIM message:

  • PIM RP Register
    This is sent from the FHR whenever it receives multicast traffic from a source device. The router is in Sparse-Mode so the packet will not be forwarded by default. Instead the received packet is encapsulated inside a PIM RP Register message and sent via unicast to the RP. The RP decapsulates the original packet and forwards it if the destination matches a multicast routing table entry populated by previous PIM Join messages. If no entry exist, the RP responds with a RP Register Stop, stopping the FHR from sending more traffic for that multicast flow. If the packet matches an entry, the RP generates a PIM Join message towards the FHR, competing the RPT.

Configuring a PIM Rendezvous Point

We add the following configuration on our routers to enable the RP functionality:

int lo0
 ip address 3.3.3.3/32
 ip ospf 1 area 0
!
ip pim rp-address 3.3.3.3

ip pim rp-address 3.3.3.3

With this configuration applied all routers know that R3 is the PIM Rendevzous Point, R1 and R2 will now send ASM PIM Joins to R3.

PIM-SM Rendezvous Point Signaling

Let's look at how PIM Sparse Mode is signalled using a Rendezvous Point, first building a root path tree and later converting it into a source path tree:

In the first image, R2 (LHR) converts the IGMP join message from PC22 into a PIM Join and forwards it towards the RP. The RP now knows that traffic to 239.1.1.1 should be forwarded to R2.

The second image show PC11 sending ping packets to 239.1.1.1, triggering R1 (FHR) to encapsulate the ping packet in a PIM RP Register message and forward it as unicast to the RP, R3.

In image three, R3 decapsulates ping packet and matches it against the multicast routing table. In this instance the ping packet is forwarded to R2. At the same time R3 sends a (10.0.1.11, 239.1.1.1) PIM Join message towards R1 to complete the RPT signalling. The (10.0.1.11, 239.1.1.1) now flows from R1 through R3 to R2.

Image four: When R2 forwards the ping packet from R3 it performs uRPF on the source IP and realizes there's a better path via R1. R2 promptly sends a (10.0.1.11, 239.1.1.1) PIM Join message to R1 and a PIM Prune message to R3, signaling that it only want to receive the traffic from R1. With these actions R2 has now closed the suboptimal Root Path Tree and opened the most optimal multicast tree, the Source Path Tree.

Note: I'm writing "towards" intentionally above. There could be any number of routers between R1-R2-R3 that participate in PIM and forward the PIM Join messages. The topology is kept small for brevity.

RPT vs SPT

As described above, a Root Path Tree is built through the Rendezvous Point allowing initial connectivity between a source and receiver for a (*,G) multicast flow. Once the Last-Hop Router learns the source IP address generating the multicast flow traffic, it can build an (S,G) Source Path Tree directly towards the First-Hop Router without having to pass through the Rendezvous Point. The goal is always to build a SPT as it takes the shortest path through the network.

Conclusion

PIM Sparse mode with SSM is very simple and scales very well since the SPT is signaled straight away. If you require ASM then you need a Renvezvous Point adding some signaling overhead when converting the RPT into an SPT. Having looked at PIM-SM, you are now more knowledgeable than you were half an hour ago.


Copyright 2021-2023, Emil Eliasson.
All Rights Reserved.